<?xml version="1.0" encoding="UTF-8"?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:p="http://primefaces.org/ui"
     template="../../Template.xhtml"
>
<ui:define name="title">Add Advertisement</ui:define>

<ui:define name="body">

<h:form>
	<p:panelGrid columns="2">
<h2>Add Advertisement</h2>
<p:commandButton ajax="false" value="Back" action="ManageAdvertisements.xhtml" />
</p:panelGrid>
</h:form>
<br/><br/><br/><br/>
<h:form>
<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />

	<p:panelGrid columns="3">
	
	  <p:outputLabel value="Select an Advertiser :" />
	  <p:selectOneMenu value="#{pubMB.idAnn}" >
	  	<f:selectItems  value="#{pubMB.listAnnonceurs}" var="a" itemValue="#{a.idAnnonceur}" itemLabel="#{a.nom}-#{a.prenom}" />
	  </p:selectOneMenu><br/>
	  
		<p:outputLabel value="link :"/>
		<p:inputText id="link" value="#{pubMB.publicite.lien}" required="true" requiredMessage="Link is required" />
		<p:message for="link" />
		
		<p:outputLabel value="image :"/>
		<p:inputText id="image" value="#{pubMB.publicite.image}" required="true" requiredMessage="image is required" />
		<p:message for="image" />
		
		<p:outputLabel value="impression :"/>
		<p:inputText id="impression" value="#{pubMB.publicite.nbrApparition}" required="true" requiredMessage="impression is required" />
		<p:message for="impression" />
		
		<p:outputLabel value="Unique :" />
		<p:selectOneMenu value="#{pubMB.publicite.unnique}" >
			<f:selectItem  itemValue="true" itemLabel="Yes"  />
			<f:selectItem  itemValue="false" itemLabel="No"  />
		</p:selectOneMenu><br/>
		
		<p:outputLabel value="Status :" />
		<p:selectOneMenu value="#{pubMB.publicite.statut}" >
			<f:selectItem  itemValue="true" itemLabel="Active"  />
			<f:selectItem  itemValue="false" itemLabel="Innactive"  />
		</p:selectOneMenu><br/>
		
		<p:outputLabel value="Urgent :" />
		<p:selectOneMenu value="#{pubMB.publicite.urgent}" >
			<f:selectItem  itemValue="true" itemLabel="Yes"  />
			<f:selectItem  itemValue="false" itemLabel="No"  />
		</p:selectOneMenu><br/>
		
		<p:commandButton ajax="false" action="#{pubMB.Ajouter}" value="Add" ></p:commandButton>
		
	</p:panelGrid>
</h:form>
	
	
</ui:define>
</ui:composition>